package com.simplecontact.classes;

import android.os.Parcel;
import android.os.Parcelable;

public class ContactBundle implements Parcelable{

	private int mId;
	private String mNickName;
	private String mFirstName;
	private String mLastName;
	private String mEmail;
	private String mPhoneNumber;
	private String mAddress;
	private String mImage;
	
	
	/**
	 * This method return Id of an object contact
     * <P>Return type: int</P>
     */
	public int getId(){
		return mId;
	}
	
	/**
	 * This method return NickName of an object contact
     * <P>Return type: String</P>
     */
	public String getNickName(){
		return mNickName;
	}
	
	/**
	 * This method return FirstName of an object contact
     * <P>Return type: String</P>
     */
	public String getFirstName(){
		return mFirstName;
	}		
	
	/**
	 * This method return LastName of an object contact
     * <P>Return type: String</P>
     */
	public String getLastName(){
		return mLastName;
	}		
	
	/**
	 * This method return Email of an object contact
     * <P>Return type: String</P>
     */
	public String getEmail(){
		return mEmail;
	}
	
	/**
	 * This method return PhoneNumber of an object contact
     * <P>Return type: String</P>
     */
	public String getPhoneNumber(){
		return mPhoneNumber;
	}
	
	/**
	 * This method return Address of an object contact
     * <P>Return type: String</P>
     */
	public String getAddress(){
		return mAddress;
	}
	
	/**
	 * This method return Image of an object contact
     * <P>Return type: Byte[]</P>
     */
	public String getImage(){
		return mImage;
	}
	/**
	 * Default constructor of ContactBundle class   
     */
	public ContactBundle(){
		mId = -1;
		mNickName = "";
		mFirstName = "";
		mLastName = "";
		mEmail = "";
		mAddress = "";
		mPhoneNumber = "";
		mImage = "";
	}
	
	/**
	 * Full constructor of ContactBundle class   
     */
	public ContactBundle(int pId, String pNickName, String pFirstName, String pLastName, String pEmail, String pAddress, String pPhoneNumber, String pImage){
		mId = pId;
		mNickName = pNickName;
		mFirstName = pFirstName;		
		mLastName = pLastName;
		mEmail = pEmail;
		mAddress = pAddress;
		mPhoneNumber = pPhoneNumber;
		mImage = pImage;	
	}	
	
	/**
	 * Object constructor of ContactBundle class   
     */
	public ContactBundle(ContactBundle cb){
		mId = cb.getId();
		mNickName = cb.getNickName();
		mFirstName = cb.getFirstName();
		mLastName = cb.getLastName();
		mEmail = cb.getEmail();
		mAddress = cb.getAddress();
		mPhoneNumber = cb.getPhoneNumber();
		mImage = cb.getImage();		
	}

	/**
	 * Parcel constructor of ContactBundle class   
     */	
	public ContactBundle(Parcel p){
		mId = p.readInt();
		mNickName = p.readString();
		mFirstName = p.readString();
		mLastName = p.readString();
		mEmail = p.readString();
		mAddress = p.readString();
		mPhoneNumber = p.readString();
		mImage = p.readString();
	}
	
	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		// TODO Auto-generated method stub
		dest.writeInt(mId);
		dest.writeString(mNickName);
		dest.writeString(mFirstName);
		dest.writeString(mLastName);
		dest.writeString(mEmail);
		dest.writeString(mAddress);
		dest.writeString(mPhoneNumber);
		dest.writeString(mImage);
	}
	public static final Parcelable.Creator<ContactBundle> CREATOR = new Creator<ContactBundle>() {
		
		@Override
		public ContactBundle[] newArray(int size) {
			return new ContactBundle[size];
		}
		
		@Override
		public ContactBundle createFromParcel(Parcel source) {
	          return new ContactBundle(source);
		}
	};
}
